﻿using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenCube.IO.Overload;
using OpenCube.Specs;

namespace OpenCube.IO.Specs
{
	[TestClass]
	public class InjectionSpecs
	{
		[TestMethod]
		public void TestMethod1()
		{
			IInjectionValidationResult validation =
				new InjectionConfigurationValidator()
					.ScanAssemblyContaining<InjectionModule>()
					.Scan();

			validation.IsRegistered<IBinaryReaderFactory>()
				.Should().BeTrue(because: "there should be a binary reader factory registered");
			validation.IsRegistered<IOverloadingFileSystemFactory>()
				.Should().BeTrue(because: "there should be a factory for overloading the filesystem");

			validation.IsRegistered<IBinaryReader>()
				.Should().BeFalse(because: "you should create it by factory, or directly from one of the types that implements it.");

			validation.ShouldHaveNoUnverifiedInterfacesLeft();
		}
	}


}
